#include <iostream>
using std::cout;
using std::endl;

/* int num = 100; */

//命名空间实际是把全局作用域划分成了更小的作用域
namespace wd
{
int num = 10;

void func(){
    cout << "wd::func()" << endl;
}
}//end of namespace wd

namespace hw
{
int num = 20;

void func(){
    cout << "hw::func()" << endl;
}
}//end of namespace hw

void test0(){
    //using编译指令
    //引入wd的所有实体
    using namespace wd;
    cout << "wd::num:" << num << endl;
    func();
}

void test1(){
    using namespace hw;
    cout << "hw::num:" << num << endl;
}

int main(void){
    test0();
    test1();
    return 0;
}
